﻿namespace BillBook.Model
{
    public class User
    {
        public long UserID { get; set; }
        public string UserName { get; set; }
        public string Password { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
        public sbyte Status { get; set; }
        public string Email { get; set; }


        public User()
        {
        }

        public bool Equals(User obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            return obj.UserID == UserID && Equals(obj.UserName, UserName) && Equals(obj.Password, Password) && Equals(obj.FirstName, FirstName) && Equals(obj.LastName, LastName) && obj.Status == Status && Equals(obj.Email, Email);
        }

        public override bool Equals(object obj)
        {
            if (ReferenceEquals(null, obj)) return false;
            if (ReferenceEquals(this, obj)) return true;
            if (obj.GetType() != typeof (User)) return false;
            return Equals((User) obj);
        }

        public override int GetHashCode()
        {
            unchecked
            {
                int result = UserID.GetHashCode();
                result = (result*397) ^ (UserName != null ? UserName.GetHashCode() : 0);
                result = (result*397) ^ (Password != null ? Password.GetHashCode() : 0);
                result = (result*397) ^ (FirstName != null ? FirstName.GetHashCode() : 0);
                result = (result*397) ^ (LastName != null ? LastName.GetHashCode() : 0);
                result = (result*397) ^ Status.GetHashCode();
                result = (result*397) ^ (Email != null ? Email.GetHashCode() : 0);
                return result;
            }
        }
    }
}